package com.ruoyi.common.enums.dict;

public enum VoiceMemoirArticleLength {

//    1：短篇，2：中篇，3：长篇
    SHORT(1, "短篇"),
    MEDIUM(2, "中篇"),
    LONG(3, "长篇");

    VoiceMemoirArticleLength(Integer value, String label){
        this.value = value;
        this.label = label;
    }

    private Integer value;
    private String label;

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    /**
     * 根据value获取label
     *
     * @param value 枚举的值
     * @return 匹配的label，如果没有找到则返回null
     */
    public static String getLabelByValue(Integer value) {
        for (VoiceMemoirWriteType type : VoiceMemoirWriteType.values()) {
            if (type.getValue().equals(value)) {
                return type.getLabel();
            }
        }
        return null; // 如果没有找到匹配的value，则返回null
    }
}
